package model

import "gorm.io/gorm"

type VideoClass struct {
	gorm.Model
	Status    int    `gorm:"type:int(1)"`
	Title     string `gorm:"type:varchar(100)"`
	ImageUrl  string `gorm:"type:varchar(500)"`
	Des       string `gorm:"type:varchar(200)"`
	ShowCount int    `gorm:"type:int(11)"`
	Tag       string `gorm:"type:enum('动画','短剧','综艺')"`
}

func (c VideoClass) ClassShowCountAdd(DB *gorm.DB) error {
	return DB.Exec("UPDATE video_classes set video_classes.show_count=video_classes.show_count+1 where id = ?", c.ID).Error
}
